/**
 * 获取数据字典信息
 * method：请求方式
 * url:请求地址，
 * param：请求参数
 */
 /*
export function getDicData(url, dicCode, key, value) {
  return new Promise((resolve, reject) => {
    this.axios.post(url + "/" + dicCode,{}).then((response) => {
      let result = response.data.map((item) => {
        let obj = {};
        obj[key] = item[key];
        obj[value] = item[value];
        return obj;
      });
      resolve(result);
    }).catch((error) => {
      reject(error);
    });
  });
}*/

export function getDicData(dicCode) {
  return new Promise((resolve, reject) => {
    this.axios.post(this.lib.config.host.system + "/common/sysdictionary/getDicItems/" + dicCode,{}).then((response) => {
      resolve(response.data);
    }).catch((error) => {
      reject(error);
    });
  });
}

export default {
  getDicData
}